package edu.ustc.iproject.service.impl;

import java.util.List;

import edu.ustc.iproject.dao.CompanyDAO;
import edu.ustc.iproject.dao.EmployeDAO;
import edu.ustc.iproject.dao.impl.CompanyDAOImpl;
import edu.ustc.iproject.dao.impl.EmployeDAOImpl;
import edu.ustc.iproject.bean.Company;
import edu.ustc.iproject.service.CompanyService;

public class CompanyServiceImpl implements CompanyService {

	public Company getSingleCompnayById(int com_id) {
	
		CompanyDAO companyDAO = new CompanyDAOImpl();
		return companyDAO.getSingleCompnayById(com_id);
		
	}

	public List<Company> listAllCompany() {
		// TODO Auto-generated method stub

		CompanyDAO companyDAO = new CompanyDAOImpl();
		return companyDAO.listAllCompany();
		
	}

	public void removeCompany(int com_id) {
		// TODO Auto-generated method stub
		CompanyDAO companyDAO= new CompanyDAOImpl();
		companyDAO.removeCompany(com_id);
	}

	public void saveCompany(Company company) {
		// TODO Auto-generated method stub
		CompanyDAO companyDAO = new CompanyDAOImpl();
		companyDAO.saveCompany(company);
		
	}

	public void updateCompany(Company company) {
		
		CompanyDAO companyDAO = new CompanyDAOImpl();
		companyDAO.updateCompany(company);
		
	}

	public Company loginCompany(String count, String code) {
		// TODO Auto-generated method stub
		System.out.println("company service");
		System.out.println("service count:"+count);
		CompanyDAO companyDAO = new CompanyDAOImpl();
		return companyDAO.loginCompany(count, code);
	}

}
